<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <title>Test</title>
</head>
<body>
<script th:src="@{jquery-3.1.1.js}" type="text/javascript"></script>
<script th:inline="javascript">
var port = [[${port}]];
alert(port);
</script>
</body>
</html>